package com.ruitu.health_2.mvp.model;

import com.ruitu.arad.api.RxUtil;
import com.ruitu.arad.base.BaseModel;
import com.ruitu.health_2.dao.http.APIRetrofit;
import com.ruitu.router_module.bean.BaseResult2;
import com.ruitu.router_module.bean.home.MallHomeData;
import com.ruitu.router_module.bean.home.ModelData;
import com.ruitu.router_module.bean.product.ReadPartyDetail;

import io.reactivex.Observable;

// 模块
public class ModelModel {

    public static class ChinaCultureM extends BaseModel {

        public Observable<BaseResult2<ModelData>> reqModelData(String modelId) {
            return APIRetrofit.getDefault()
                    .reqModelData(modelId)
                    .compose(RxUtil.<BaseResult2<ModelData>>subIoObMain());
        }

        public Observable<BaseResult2<MallHomeData>> reqChinaCultureHomeData() {
            return APIRetrofit.getDefault()
                    .reqChinaCultureHomeData()
                    .compose(RxUtil.<BaseResult2<MallHomeData>>subIoObMain());
        }
    }

    public static class EduCultureM extends BaseModel {

        public Observable<BaseResult2<MallHomeData>> reqEduCultureHomeData() {
            return APIRetrofit.getDefault()
                    .reqEduCultureHomeData()
                    .compose(RxUtil.<BaseResult2<MallHomeData>>subIoObMain());
        }
    }

    public static class CultureTravelM extends BaseModel {

        public Observable<BaseResult2<MallHomeData>> reqCultureTravelHomeData() {
            return APIRetrofit.getDefault()
                    .reqCultureTravelHomeData()
                    .compose(RxUtil.<BaseResult2<MallHomeData>>subIoObMain());
        }
    }

    public static class ReadPartieM extends BaseModel {

        public Observable<BaseResult2<MallHomeData>> reqReadPartieHomeData() {
            return APIRetrofit.getDefault()
                    .reqReadPartieHomeData()
                    .compose(RxUtil.<BaseResult2<MallHomeData>>subIoObMain());
        }

        public Observable<BaseResult2<ModelData>> reqModelData(String modelId) {
            return APIRetrofit.getDefault()
                    .reqModelData(modelId)
                    .compose(RxUtil.<BaseResult2<ModelData>>subIoObMain());
        }
    }

    public static class ReadPartieDetailM extends BaseModel {

        public Observable<BaseResult2<ReadPartyDetail>> reqReadPartieDetail(String id) {
            return APIRetrofit.getDefault()
                    .reqReadPartieDetail(id)
                    .compose(RxUtil.<BaseResult2<ReadPartyDetail>>subIoObMain());
        }
    }

    public static class HealthManageM extends BaseModel {

        public Observable<BaseResult2<ModelData>> reqModelData(String modelId) {
            return APIRetrofit.getDefault()
                    .reqModelData(modelId)
                    .compose(RxUtil.<BaseResult2<ModelData>>subIoObMain());
        }

        public Observable<BaseResult2<MallHomeData>> reqHealthManageHomeData() {
            return APIRetrofit.getDefault()
                    .reqHealthManageHomeData()
                    .compose(RxUtil.<BaseResult2<MallHomeData>>subIoObMain());
        }
    }

    public static class LifeColorM extends BaseModel {

        public Observable<BaseResult2<MallHomeData>> reqLifeColorHomeData() {
            return APIRetrofit.getDefault()
                    .reqLifeColorHomeData()
                    .compose(RxUtil.<BaseResult2<MallHomeData>>subIoObMain());
        }
    }
}
